<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/head::common_head('首页')"></head>
<body>
	<div class="main-content">
		<form id="submitForm" class="form-horizontal">
			<div class="layui-upload">
				<button type="button" class="layui-btn layui-btn-normal" id="test8">选择文件</button>
				<button type="button" class="layui-btn" id="test9">开始上传</button>
			</div>
		</form>
	</div>
	<div th:include="common/script::common_script"></div>
	<div th:include="common/validate::validate_script"></div>
</body>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
	layui.use('upload', function() {
		var $ = layui.jquery, upload = layui.upload;
		//选完文件后不自动上传
		upload.render({
			elem : '#test8',
			url : '/upload/',
			auto : false,
			size : 60, //限制文件大小，单位 KB
			//,multiple: true
			bindAction : '#test9',
			accept : 'file', //普通文件
			exts : 'zip|rar|7z', //只允许上传压缩文件
			done : function(res) {
				console.log(res)
			}
		});
	});
</script>
</html>
